package org.jmetrix.et.sample;

/**
 * @author Konstantin Kuzmin
 * @version $Revision$
 * @since 01.10.11
 */
public class SomeClass {
    public void someComplexMethod(final long millisToSleep) {
        someMethod1(millisToSleep);
        someMethod2(millisToSleep);
    }

    public void someMethod1(final long millisToSleep) {
        sleep(millisToSleep);
    }

    public void someMethod2(final long millisToSleep) {
        sleep(millisToSleep * 2);
    }

    public void throwExceptionMethod(final long millisToSleep) throws Exception {
        sleep(millisToSleep * 10);
        throw new RuntimeException("Test exception");
    }

    private static void sleep(long millisToSleep) {
        try {
            Thread.sleep(millisToSleep);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
